<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>clazz</title>
</head>
<body>
<h1>clazz</h1>
<form action="addOrUpdate" method="post">
    <input type="number" name="cid" placeholder="id，存在则为修改"><br />
    <input type="text" name="cname" placeholder="新班级名"><br />
    <input type="submit" value="添加/修改">
</form>
<form action="selById">
    <input type="number" name="cid" placeholder="班级id"><br />
    <input type="submit" value="查询">
</form>
<strong th:text="${status_message}">暂无操作</strong>
<table border="1">
    <tr>
        <td>班级编号</td>
        <td>班级名称</td>
        <td>创建时间</td>
        <td>更新时间</td>
        <td>操作</td>
    </tr>
    <!-- thymeleaf遍历 -->
    <tr th:each="clazz:${clazzList}">
        <td th:text="${clazz.cid}"></td>
        <td th:text="${clazz.cname}"></td>
        <td th:text="${clazz.createTime}"></td>
        <td th:text="${clazz.updateTime}"></td>
        <td>
            <!--原有的方式-->
<!--            <a th:href="'/user/del?age='+${user.age}">删除</a>-->
            <!--thymeleaf模板独有的-->
            <a th:href="@{/clazz/del(cid=${clazz.cid})}">删除</a>
        </td>
    </tr>
</table>
<h5 th:text="${message}"></h5>
</body>
</html>